if ((global.control == 1) and (global.cutscene == false))
{
if (ds_list_find_value(global.team,global.team_member_current) == id)
{
if (character_climb == true)
{
if ((place_meeting(x,y, obj_ladder) == true) and (keyboard_check(vk_up) == true))
{
character_climbdir = -1;
}
else
{
if ((place_meeting(x,((y div 16) + 1) * 16, obj_ladder) == true) and (keyboard_check(vk_down) == true))
{
character_climbdir = 1;
}
else
{
character_climbdir = 0;
}
}
if (place_meeting(x,y,obj_ladder) == false) or (character_walk == true) or (character_jump == true)
{
character_climb = false;
character_climbdir = 0;
if (place_meeting(x,y + actor_g,obj_ladder) == true) and (character_walk == false) and (character_jump == false)
{
y = instance_place(x,y + actor_g,obj_ladder).y - (sprite_height / 2);
actor_vsp = 0;
}
if (character_walk == true) or (character_jump == true)
{
character_havejumped = 1;
actor_onfakeground = false;
}
}
}
else
{
if (place_meeting(x,y,obj_ladder) == true) and ((place_meeting(x,((y div 16) - 1) * 16, obj_ladder) == true) and (keyboard_check(vk_up) == true)) or ((place_meeting(x,((y div 16) + 1) * 16, obj_ladder) == true) and (keyboard_check(vk_down) == true))
{
character_climb = true;
character_havejumped = -2;
character_havewalked = false;
actor_vsp = 0;
if (place_meeting(x,y,obj_ladder) == false) and (place_meeting(x,y + actor_g,obj_ladder) == true)
{
y += 1;
}
}
}
if (actor_onwater == false)
{
if (character_climb == false)
{
character_jump = (keyboard_check(global.button[0]) == true);
}
else
{
character_jump = (keyboard_check(global.button[0]) == true) and (character_havejumped == -2);
}
if (place_meeting(x,y + (actor_g),obj_solid) == true)
{
character_sprint = (keyboard_check(global.button[1]) == true);
}
}
else
{
character_jump = (keyboard_check_pressed(global.button[0]) == true);
character_sprint = false;
}
if (character_havewalked == false)
{
character_walk = (((keyboard_check(vk_left) == true)) xor (keyboard_check(vk_right) == true)) and (character_climb == false);
character_direction = (((keyboard_check(vk_left) == true) * -1) + ((keyboard_check(vk_right) == true) * 1));
}
else
{
character_walk = (((keyboard_check(vk_left) == true) and (actor_hsp < 0)) xor ((keyboard_check(vk_right) == true) and (actor_hsp > 0)));
}
character_attack = (keyboard_check_pressed(global.button[1]) == true) && (character_haveattacked == false);
character_talk = ((keyboard_check_pressed(global.button[2]) == true) && (character_talking_to > 0) && (character_vsp == 0));
character_use_item = ((keyboard_check(global.button[3]) == true) && (character_item_equipped != -1));
view_object[0] = id;
depth = -1;
}
else
{
if (ds_list_find_index(global.team,id) > -1)
{
character_behavior_follow();
depth = 0;
}
}
}
